#include <stdio.h>
#include <time.h>
//#define LOOP_NUM 1000000000000

void GetTime()
{
    time_t nowtime;
    struct tm *timeinfo;
    time( &nowtime );
    timeinfo = localtime( &nowtime );
    int year, month, day, hour, min, second;
    year = timeinfo->tm_year + 1900;
    month = timeinfo->tm_mon + 1;
    day = timeinfo->tm_mday;
    hour = timeinfo->tm_hour;
    min = timeinfo->tm_min;
    second = timeinfo->tm_sec;    
    printf("%d %d %d %d %d %d\n", year, month, day, hour, min, second);
    return;   
}

void fun1(long int n)
{
    long int i;
    long int j = 0;
    for (i = 0; i < n; i++)
    {
	j = 1*4;
    }
    return;
}

void fun2(long int n)
{
    long int i;
    long int j = 0;
    for (i = 0; i < n; i++)
    {
        j = 1<<2;
    }
    return;
}

int main(int args, int *argv)
{
    if (args < 3)
    {
	printf("Input 3 or more args\n");
	return 1;
    }
    printf("Loop is %lu\n", LOOP_NUM);
    printf("Begin to fun1()\n");
    GetTime();
    fun1(LOOP_NUM);
    GetTime();
    printf("End to fun1()\n");
    printf("Sleep is %d\n", 5);
    
    printf("Begin to fun2()\n");
    GetTime();
    fun2(LOOP_NUM);
    GetTime();
    printf("End to fun2()\n");
    return 0;
}
